﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace _300Report.Converter
{
    public class WinLoseBackgroundConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            switch ((int)value)
            {
                case 1://胜
                    return new SolidColorBrush((Color)App.Current.Resources["Win"]);
                 
                case 2://败
                    return new SolidColorBrush((Color)App.Current.Resources["Lose"]);
                   
                case 3://逃
                    return new SolidColorBrush((Color)App.Current.Resources["Run"]);
                    break;
                default :
                    return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
